<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>完美电商</title>
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath }/static/vendors/bootstrap/dist/css/bootstrap.min.css"
          rel="stylesheet">
    <!-- Font Awesome -->
    <link href="${pageContext.request.contextPath }/static/vendors/font-awesome/css/font-awesome.min.css"
          rel="stylesheet">
    <!-- NProgress -->
    <link href="${pageContext.request.contextPath }/static/vendors/nprogress/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="${pageContext.request.contextPath }/static/vendors/iCheck/skins/flat/green.css" rel="stylesheet">
    <!-- bootstrap-progressbar -->
    <link href="${pageContext.request.contextPath }/static/vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css"
          rel="stylesheet">
    <!-- JQVMap -->
    <link href="${pageContext.request.contextPath }/static/vendors/jqvmap/dist/jqvmap.min.css" rel="stylesheet"/>

    <!-- Custom Theme Style -->
    <link href="${pageContext.request.contextPath }/static/build/css/custom.min.css" rel="stylesheet">
    <style>
        th{
            text-align: center;
            vertical-align: middle;
        }
        td {
            vertical-align: middle;
            text-align: center;
        }
    </style>
</head>

<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <%@include file="/WEB-INF/jsps/menu.jsp" %>
        <!-- top navigation -->
        <%@include file="/WEB-INF/jsps/top.jsp" %>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <%--添加主体内容--%>
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>商品图片列表
                                <small>商品图片列表详情</small>
                            </h2>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">

                            <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>商品编号</th>
                                    <th>商品名称</th>
                                    <th>商品图片</th>
                                    <th style="width: 200px;">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${pageInfo.list}" var="mImg">
                                    <tr>
                                        <th scope="row">${mImg.pid}</th>
                                        <td scope="row">${mImg.pname}</td>
                                        <td class="project_progress">
                                            <ul class="list-inline">
                                                <c:forEach items="${mImg.productpicList}" var="mpic">
                                                    <li>
                                                        <img src="${pageContext.request.contextPath}/product/showPic.do?picid=${mpic.picid}" width="40" height="40" class="avatar"
                                                             alt="商品图片">
                                                    </li>
                                                </c:forEach>
                                            </ul>
                                        </td>
                                        <td>
                                            <a href="${pageContext.request.contextPath}/product/editproductImgList?pid=${mImg.pid}"
                                               class="btn btn-info btn-xs"><i
                                                    class="fa fa-pencil"></i>
                                                编辑 </a>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                            <nav aria-label="Page navigation">
                                <ul class="pagination">

                                    <li>
                                        <c:choose>
                                            <c:when test="${pageInfo.hasPreviousPage}">
                                                <a href="${pageContext.request.contextPath }/product/productImgListView?pageNum=${pageInfo.pageNum-1}"
                                                   aria-label="Previous">
                                                    <span aria-hidden="true">&laquo;</span>
                                                </a>
                                            </c:when>
                                            <c:otherwise>
                                                <a href="${pageContext.request.contextPath }/product/productImgListView?pageNum=1"
                                                   aria-label="Previous">
                                                    <span aria-hidden="true">&laquo;</span>
                                                </a>
                                            </c:otherwise>
                                        </c:choose>
                                    </li>
                                    <c:forEach items="${pageInfo.navigatepageNums }" var="nums">
                                        <li <c:if test="${pageInfo.pageNum==nums }">class="active"</c:if>>
                                            <a href="${pageContext.request.contextPath }/product/productImgListView?pageNum=${nums }">${nums }</a>
                                        </li>
                                    </c:forEach>
                                    <li>
                                        <c:choose>
                                            <c:when test="${pageInfo.hasNextPage }">

                                                <a href="${pageContext.request.contextPath }/product/productImgListView?pageNum=${pageInfo.pageNum+1}"
                                                   aria-label="Next">
                                                    <span aria-hidden="true">&raquo;</span>
                                                </a>
                                            </c:when>
                                            <c:otherwise>
                                                <a href="${pageContext.request.contextPath }/product/productImgListView?pageNum=${pageInfo.pages}"
                                                   aria-label="Next">
                                                    <span aria-hidden="true">&raquo;</span>
                                                </a>
                                            </c:otherwise>
                                        </c:choose>
                                    </li>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
            <br/>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <%@include file="/WEB-INF/jsps/footer.jsp" %>
        <!-- /footer content -->
    </div>
</div>

<!-- jQuery -->
<script src="${pageContext.request.contextPath }/static/vendors/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="${pageContext.request.contextPath }/static/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- FastClick -->
<script src="${pageContext.request.contextPath }/static/vendors/fastclick/lib/fastclick.js"></script>
<!-- NProgress -->
<script src="${pageContext.request.contextPath }/static/vendors/nprogress/nprogress.js"></script>
<!-- Chart.js -->
<!-- bootstrap-progressbar -->
<script src="${pageContext.request.contextPath }/static/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<!-- iCheck -->
<script src="${pageContext.request.contextPath }/static/vendors/iCheck/icheck.min.js"></script>
<!-- Skycons -->
<script src="${pageContext.request.contextPath }/static/vendors/skycons/skycons.js"></script>
<!-- Custom Theme Scripts -->
<script src="${pageContext.request.contextPath }/static/build/js/custom.min.js"></script>
</body>
</html>
